package com.reizx.xposeddemo;

import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

public class MainActivity extends AppCompatActivity{
    @ViewInject(R.id.btnToast)
    private Button btnToast;
    @ViewInject(R.id.btnClearSP)
    private Button btnClearSP;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        x.view().inject(this);
        clearSP();
    }

    //注意，事件必须为private属性，为public失败
    @Event(value = {R.id.btnToast, R.id.btnClearSP},type=View.OnClickListener.class)
    private void onClick(View v) {
        switch (v.getId()) {
            case R.id.btnToast: {
                Toast.makeText(getApplicationContext(), "test", Toast.LENGTH_SHORT).show();
                break;
            }case R.id.btnClearSP:{
                clearSP();
                Toast.makeText(getApplicationContext(), "xxxxxxxxxxxxxxxxxxx", Toast.LENGTH_SHORT).show();
                break;
            }default:
                break;
        }
    }

    public void clearSP(){
        Settings.System.putString(getApplication().getContentResolver(), "mqBRboGZkQPcAkyk", "" );
        Settings.System.putString(getApplication().getContentResolver(), "dxCRMxhQkdGePGnp", "" );
        Settings.System.putString(getApplication().getContentResolver(), "6c709c11d2d46a7b", "" );
        Settings.System.putString(getApplication().getContentResolver(), "dd7893586a493dc3", "" );
        Settings.System.putString(getApplication().getContentResolver(), "58669b0e4dd2beb8", "" );
        Settings.System.putString(getApplication().getContentResolver(), "85d32f14e4edccf2", "" );
        Settings.System.putString(getApplication().getContentResolver(), "e5c06c338bfa3568", "" );
        Settings.System.putString(getApplication().getContentResolver(), "636f6d2e77616e646f756a69612e70686f656e697832dynamicreid\n", "" );
        Settings.System.putString(getApplication().getContentResolver(), "636f6d2e77616e646f756a69612e70686f656e697832dynamicrsid", "" );
        Settings.System.putString(getApplication().getContentResolver(), "time_12_24", "" );
    }
}
